#-*- coding:gbk -*-
'''
Created on 2012-7-23

@author: xxy
'''

import item
import world_message

class EquipType(object):
    WEAPON = 0x000
    ARMOR = 0x001

class Equip(item.Item):
    def __init__(self, name, equip_type):
        item.Item.__init__(self, name, item.ItemType.EQUIP)
        self.m_equip_type = equip_type
        self.m_physical_attack = 0
        self.m_magic_attack = 0
        self.m_physical_defence = 0
        self.m_magic_defence = 0
        self.m_speed = 0
        self.m_distance = 0
        self.m_hp = 0
        self.m_mp = 0
        self.m_attack_period = 0
        
    def toDict(self):
        attr_dict = {}
        
        attr_dict[world_message.MessageAttr.EQUIP_TYPE] = self.m_equip_type
        attr_dict[world_message.MessageAttr.DISTANCE] = self.m_distance
        attr_dict[world_message.MessageAttr.PYS_ATTACK] = self.m_physical_attack
        attr_dict[world_message.MessageAttr.MGI_ATTACK] = self.m_magic_attack
        attr_dict[world_message.MessageAttr.PYS_DEFENCE] = self.m_physical_defence
        attr_dict[world_message.MessageAttr.MGI_DEFENCE] = self.m_magic_defence
        attr_dict[world_message.MessageAttr.PERIOD] = self.m_attack_period
        attr_dict[world_message.MessageAttr.SPEED] = self.m_speed
        attr_dict[world_message.MessageAttr.HP] = self.m_hp
        attr_dict[world_message.MessageAttr.MP] = self.m_mp
        
        return attr_dict